using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IQIGame.Onigao.Framework
{
    public abstract class ProcedureBase : IProcedure
    {
        private ProcedureFSM m_Mgr;
        public virtual void OnInit(ProcedureFSM mgr)
        {
            m_Mgr = mgr;
        }

        public virtual void OnDestroy()
        {
            m_Mgr = null;
        }

        public abstract void OnEnter();
        public abstract void OnUpdate(float deltaTime, float unscaledDeltaTime);
        public abstract void OnLeave();

        public void ChangeState<T>() where T : ProcedureBase
        {
            m_Mgr.ChangeState<T>();
        }
    }
}
